package com.bw.router.provider

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.bw.base.constants.ApiConst
import com.bw.base.constants.RoutePath
import com.tencent.mmkv.MMKV

/**
 * 提供服务的具体实现
 */

@Route(path = RoutePath.PATH_PROVIDER_SERVICE)
class RouteProviderImpl : IRouteProvider {

    private lateinit var mContext: Context

    override fun init(context: Context?) {
        if (context != null) {
            mContext = context
        }
    }

    override fun getLoginToken(): String {
        val token = MMKV.defaultMMKV().decodeString(ApiConst.PARAM_TOKEN, "")
        return token ?: ""
    }

    override fun getAccessId(): String {

        val accessId = MMKV.defaultMMKV().decodeString(ApiConst.PARAM_ACCESS_ID, "")
        return accessId ?: ""
    }

}